package cn.aaa.controller.manager;

import cn.aaa.domain.OpenIdResult;
import cn.aaa.result.JSONResult;
import cn.aaa.service.IWechatRegisterService;
import cn.dev33.satoken.annotation.SaIgnore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wechat")
public class WechatRegisterController {
    @Autowired
    private IWechatRegisterService wechatRegisterService;
    
    @SaIgnore
    @GetMapping("/register/{code}")
    public JSONResult<OpenIdResult> register(@PathVariable("code") String code) {
        return wechatRegisterService.getOpenId(code);
    }
}
